//
//@File    :	13.6_usett1.cpp
//@Time    :	2021/09/18 14:49:03
//@Auther  :	Sun Sheng
//@Contact :	970340843@qq.com
//@Desc    :	using a base class and derived class
//

#include <iostream>
#include "13.4_tabtenn1.h"
int main()
{
    using std::cout;
    using std::endl;
    TableTennisPlayer player1("Chuck", "Blizzard", false);
    RatedPlayer rplayer1(1140, "Mallory", "Duck", true);
    rplayer1.Name();
    if (rplayer1.HasTable())
    {
        cout << ": has a table.\n";
    }
    else
    {
        cout << ": hasn't a table.\n";
    }
    player1.Name();
    //判断是否有球桌,并输出结果
    if (player1.HasTable())
    {
        cout << ": has a table.\n";
    }
    else
    {
        cout << ": hasn't a table.\n";
    }
    cout << "Name: ";
    rplayer1.Name();
    cout << ";Rating: " << rplayer1.Rating() << endl;
    //initialize RatedPlayer using TableTennisPlayer object
    RatedPlayer rplayer2(1212, player1);
    cout << "Name: ";
    rplayer2.Name();
    cout << ";Rating: " << rplayer2.Rating() << endl;
    system("pause");
    return 0;
}
